home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2002 January / january_2002.iso / Piposh Special / Piposh / WEST1.DXR / 00152.ls < prev    next >
Encoding:
Text File  |  2004-12-06  |  7.0 KB  |  189 lines

  1. on exitFrame
  2.   global mnv, ppl, bltx, blty, bltsprite, bltwich, psila, fxpath, trgt, vppl, hppl, ypnt, xpnt
  3.   strata()
  4.   if (the keyCode > 122) and (getAt(mnv, 1) > 1) and (psila > 0) then
  5.     x = the memberNum of sprite getAt(ppl, 1) + 1
  6.     if ((the keyCode = 126) and (x = 36)) or ((the keyCode = 125) and (x = 24)) or ((the keyCode < 125) and (x = 12)) then
  7.       x = x - 10
  8.     end if
  9.     set the member of sprite getAt(ppl, 1) to member(x, 1)
  10.     case the keyCode of
  11.       123:
  12.         he = -10
  13.       124:
  14.         he = 10
  15.       125:
  16.         ve = 6
  17.       126:
  18.         ve = -6
  19.     end case
  20.     setAt(vppl, 1, getAt(vppl, 1) + ve)
  21.     setAt(hppl, 1, getAt(hppl, 1) + he)
  22.     set the locH of sprite getAt(ppl, 1) to the locH of sprite getAt(ppl, 1) + he
  23.     set the locV of sprite getAt(ppl, 1) to the locV of sprite getAt(ppl, 1) + ve
  24.   else
  25.     if getAt(mnv, 1) > 10 then
  26.       set the member of sprite getAt(ppl, 1) to member(43, 1)
  27.       setAt(mnv, 1, 1)
  28.     else
  29.       if getAt(mnv, 1) > 1 then
  30.         setAt(mnv, 1, getAt(mnv, 1) - 1)
  31.         if getAt(mnv, 1) = 1 then
  32.           case the memberNum of sprite getAt(ppl, 1) of
  33.             48:
  34.               set the member of sprite getAt(ppl, 1) to member(44, 1)
  35.             42:
  36.               set the member of sprite getAt(ppl, 1) to member(38, 1)
  37.             53:
  38.               set the member of sprite getAt(ppl, 1) to member(49, 1)
  39.           end case
  40.         else
  41.           x = the memberNum of sprite getAt(ppl, 1)
  42.           set the member of sprite getAt(ppl, 1) to member(x + 1, 1)
  43.         end if
  44.       end if
  45.     end if
  46.   end if
  47.   if count(blty) > 0 then
  48.     repeat with i = 1 to count(blty)
  49.       if getAt(bltx, i) <> 0 then
  50.         set the locH of sprite getAt(bltsprite, i) to the locH of sprite getAt(bltsprite, i) + getAt(bltx, i)
  51.       end if
  52.       if getAt(blty, i) <> 0 then
  53.         set the locV of sprite getAt(bltsprite, i) to the locV of sprite getAt(bltsprite, i) + getAt(blty, i)
  54.       end if
  55.       if sprite(getAt(bltsprite, i)).within(getAt(ppl, 1)) and (getAt(bltwich, i) = "bad") and (sprite(10).visible = 0) then
  56.         set the loc of sprite getAt(bltsprite, i) to point(690, 490)
  57.         deleteAt(bltx, i)
  58.         deleteAt(bltsprite, i)
  59.         deleteAt(blty, i)
  60.         deleteAt(bltwich, i)
  61.         psila = psila - 1
  62.         set the member of sprite 20 to member(the memberNum of sprite 20 + 1, 1)
  63.         if psila = 0 then
  64.           sound playFile 1, fxpath & "madead.aif"
  65.           set the keyDownScript to EMPTY
  66.           set the keyUpScript to EMPTY
  67.           set the member of sprite getAt(ppl, 1) to member(54, 1)
  68.           updateStage()
  69.           setAt(mnv, 1, 6)
  70.         else
  71.           sound playFile 1, fxpath & "mahit.aif"
  72.         end if
  73.         next repeat
  74.       end if
  75.       if not sprite(getAt(bltsprite, i)).within(66) then
  76.         set the loc of sprite getAt(bltsprite, i) to point(690, 490)
  77.         deleteAt(bltx, i)
  78.         deleteAt(bltsprite, i)
  79.         deleteAt(blty, i)
  80.         deleteAt(bltwich, i)
  81.         next repeat
  82.       end if
  83.       if getAt(bltwich, i) = "good" then
  84.         repeat with w = 2 to count(vppl)
  85.           if (getAt(vppl, w) < 1000) and sprite(getAt(bltsprite, i)).intersects(getAt(ppl, w)) and (getAt(trgt, w) <> "m") then
  86.             set the loc of sprite getAt(bltsprite, i) to point(690, 490)
  87.             deleteAt(bltx, i)
  88.             deleteAt(bltsprite, i)
  89.             deleteAt(blty, i)
  90.             deleteAt(bltwich, i)
  91.             if (the memberNum of sprite getAt(ppl, w) < 112) and (the memberNum of sprite getAt(ppl, w) > 92) then
  92.               set the memberNum of sprite getAt(ppl, w) to 112
  93.             else
  94.               set the memberNum of sprite getAt(ppl, w) to 87
  95.             end if
  96.             sound playFile 1, fxpath & "badhit.aif"
  97.             setAt(mnv, w, 6)
  98.             setAt(trgt, w, "a")
  99.             setAt(hppl, w, 1000 + w)
  100.             w = count(vppl) + 1
  101.           end if
  102.         end repeat
  103.       end if
  104.     end repeat
  105.   end if
  106.   repeat with i = 2 to count(trgt)
  107.     if getAt(trgt, i) <> "a" then
  108.       if getAt(mnv, i) < 30 then
  109.         if (getAt(trgt, i) = "s") or (getAt(trgt, i) = "b") or (getAt(trgt, i) = "r") then
  110.           yr = the memberNum of sprite getAt(ppl, i) + 1
  111.           case yr of
  112.             165:
  113.               yr = 157
  114.             105:
  115.               yr = 94
  116.             76:
  117.               yr = 68
  118.           end case
  119.           if (getAt(vppl, i) <= getAt(ypnt, i)) and ((getAt(hppl, i) >= (getAt(xpnt, i) - 20)) and (getAt(hppl, i) <= (getAt(xpnt, i) + 20))) then
  120.             if the memberNum of sprite getAt(ppl, i) < 76 then
  121.               yr = 68
  122.             else
  123.               if the memberNum of sprite getAt(ppl, i) < 105 then
  124.                 yr = 105
  125.               else
  126.                 if getAt(trgt, i) <> "r" then
  127.                   yr = 156
  128.                 end if
  129.               end if
  130.             end if
  131.           end if
  132.           set the member of sprite getAt(ppl, i) to member(yr, 1)
  133.           if getAt(vppl, i) > getAt(ypnt, i) then
  134.             set the locV of sprite getAt(ppl, i) to the locV of sprite getAt(ppl, i) - 4
  135.             setAt(vppl, i, the locV of sprite getAt(ppl, i))
  136.           else
  137.             if getAt(vppl, i) <= (getAt(ypnt, i) - 10) then
  138.               set the locV of sprite getAt(ppl, i) to the locV of sprite getAt(ppl, i) + 4
  139.               setAt(vppl, i, the locV of sprite getAt(ppl, i))
  140.             end if
  141.           end if
  142.           if getAt(hppl, i) < (getAt(xpnt, i) - 10) then
  143.             set the locH of sprite getAt(ppl, i) to the locH of sprite getAt(ppl, i) + 7
  144.             setAt(hppl, i, the locH of sprite getAt(ppl, i))
  145.           else
  146.             if getAt(hppl, i) >= (getAt(xpnt, i) + 10) then
  147.               set the locH of sprite getAt(ppl, i) to the locH of sprite getAt(ppl, i) - 7
  148.               setAt(hppl, i, the locH of sprite getAt(ppl, i))
  149.             end if
  150.           end if
  151.         else
  152.           if getAt(trgt, i) = "m" then
  153.             setAt(mnv, i, getAt(mnv, i) - 1)
  154.             if getAt(mnv, i) < 1 then
  155.               sprite(getAt(ppl, i)).visible = 1
  156.             end if
  157.           end if
  158.         end if
  159.       else
  160.         yr = the memberNum of sprite getAt(ppl, i) + 1
  161.         set the member of sprite getAt(ppl, i) to member(yr, 1)
  162.         setAt(mnv, i, getAt(mnv, i) - 1)
  163.         if getAt(mnv, i) = 30 then
  164.           if the memberNum of sprite getAt(ppl, i) < 81 then
  165.             set the memberNum of sprite getAt(ppl, i) to 68
  166.             setAt(mnv, i, 0)
  167.           else
  168.             if the memberNum of sprite getAt(ppl, i) < 87 then
  169.               set the memberNum of sprite getAt(ppl, i) to 157
  170.               setAt(mnv, i, 0)
  171.             else
  172.               if the memberNum of sprite getAt(ppl, i) < 112 then
  173.                 set the memberNum of sprite getAt(ppl, i) to 93
  174.                 setAt(mnv, i, 0)
  175.               end if
  176.             end if
  177.           end if
  178.         end if
  179.       end if
  180.       next repeat
  181.     end if
  182.     if getAt(mnv, i) > 1 then
  183.       yr = the memberNum of sprite getAt(ppl, i) + 1
  184.       set the member of sprite getAt(ppl, i) to member(yr, 1)
  185.       setAt(mnv, i, getAt(mnv, i) - 1)
  186.     end if
  187.   end repeat
  188. end
  189.